A collecton of PowerShell scripts to automate WebLogic patching.
These scripts are writtin in PowerShell. If PowerShell scripts are not enabled on the server, run this command to allow PowerShell scripts to run: set-executionpolicy unrestricted
-
Install new SmartUpdate version (3.3.0)
.\installSmartUpdate.ps1
The
silent.xml
file is used for a silent install (no prompts). The installation directory is set toe:\oracle
. If you want a different directory, change the value for "BEAHOME". -
Stop all web servers running on the server
.\stopPIAServices.ps1
The script looks for any Windows service that containts "*-PIA" in the name. If you have any WebLogic domains were not created by the
installNTService
script, you may need to shut them down by hand. -
Prepare and copy files from the
weblogic1036-2015-CVE-Patches
folder.\prepareFiles.ps1
This script performs tasks to prepare different files for patching:
On our servers, two files needed updates to correctly run the Smart Update utility.
registry.xml
needed to remove a reference to Tuxedo;bsu.cmd
needed an increase in memory to the Java Heap. Theregistry.xml
file also contains a reference to the server is was installed. The script will modify that value based on the new server's name. The original files are backed up first and a.bkp
extension is added to the file name.The script also copies
jdk-1.7.0_79
to oure:\java
folder. If you want the new java version in a different location, you can modify the path in the file. -
Apply both WebLogic patches
.\applyWebLogicPatches.ps1
Both patches are applied to WebLogic using the
bsu
command. The script assumes your patches are in the foldere:\patches\cve-2015-4852
.NOTE: On one of our servers, the second patch stalled during the "Checking for Conflicts" step. If the script stalls there for more than a few minutes, hit
Cntl-J
. -
Update the JAVA_HOME values
.\updateJavaVersion.ps1
The
JAVA_HOME
value in thesetEnv.cmd
script will be updated to the new path. This script must be updated for each server. The paths in the script are hard-coded. (The hard coding is an obvious candidate to fix next. Should be able to use the Get-ChildItem cmdlet to find all thesetEnv.cmd
files.) -
Update Registry value for JAVA_HOME
.\updateRegistryJavaVersion.ps1
The
JAVA_HOME
value in the Registry for each web service will be updated. This script must be updated for each server. The paths in the script are hard-coded. (The next place for improvement. Need to find a search cmdlet for the Registry. Could look for-PIA
in the service name.) -
Start all web servers running on the server.
.\startPIAServices.ps1
Again, this looks for all Windows services that have
*-PIA
in the name and starts them.
Use this chart to track the patch as you move it to each server and web instance.
Domain | Server | WebLogic Patch | Java Patch | Note |
---|---|---|---|---|
hr92dmo | hrweb-d1 | 12/1/2015 | 12/1/2015 | |
elm92dmo | elmweb-d1 | 12/2/2015 | 12/2/2015 | |
fs92dmo | fsweb-d1 | 12/3/2015 | 12/3/2015 |